package com.snow.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.snow.bean.User;
import com.snow.serviceImpl.UserServiceImpl;

@Controller 
public class UserWebController {

    @Autowired
    private UserServiceImpl userService;
    
    @RequestMapping("/queyrUserLsit.htm")
    public String queyrUserLsit(Model model,HttpServletRequest request) {
       List<User> userList = userService.selectAll();
       model.addAttribute("userList", userList);
       model.addAttribute("path", request.getServletPath());
       //System.out.println(request.getServletPath());
        return "userList";
    }
    
}
